Release 10.1A: OpenEdge Getting Started:
Object-oriented Programming


TYPE-OF function

TYPE-OF is a built-in LOGICAL function that verifies that a specified object reference points to an object that is defined as a specified class, inherits from a specified class, or implements a specified interface.

This is the syntax for the TYPE-OF function:

Syntax
TYPE-OF (object-reference, type-name) 

Element descriptions for this syntax diagram follow:

object-reference

An object reference defined as any class or interface type.

type-name

The type name of a class or interface. For more information on type names, see the "Using the CLASS construct" section or the "Using the INTERFACE construct" section, respectively.

The function verifies that the object referenced by the specified object-reference satisfies one of the following conditions:

  1. Matches the class or interface type specified by type-name.
  2. Is a subclass of the class type specified by type-name.
  3. Implements the interface type specified by type-name.

If any of these conditions are valid, this function returns TRUE. If none are valid, this function returns FALSE. If object-reference does not point to a valid object (see the "VALID-OBJECT function" section), the TYPE-OF function returns the Unknown value (?).


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095